<?php

/**
 * Clientes form base class.
 *
 * @method Clientes getObject() Returns the current form's model object
 *
 * @package    catalogo
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseClientesForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'codcli'  => new sfWidgetFormInputHidden(),
      'nombre'  => new sfWidgetFormInputText(),
      'dir'     => new sfWidgetFormInputText(),
      'prov'    => new sfWidgetFormInputText(),
      'pob'     => new sfWidgetFormInputText(),
      'cp'      => new sfWidgetFormInputText(),
      'tlf'     => new sfWidgetFormInputText(),
      'percon'  => new sfWidgetFormInputText(),
      'falta'   => new sfWidgetFormDateTime(),
      'usralta' => new sfWidgetFormInputText(),
      'logo'    => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'codcli'  => new sfValidatorChoice(array('choices' => array($this->getObject()->get('codcli')), 'empty_value' => $this->getObject()->get('codcli'), 'required' => false)),
      'nombre'  => new sfValidatorString(array('max_length' => 80)),
      'dir'     => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'prov'    => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'pob'     => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'cp'      => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'tlf'     => new sfValidatorString(array('max_length' => 12, 'required' => false)),
      'percon'  => new sfValidatorString(array('max_length' => 80, 'required' => false)),
      'falta'   => new sfValidatorDateTime(),
      'usralta' => new sfValidatorString(array('max_length' => 15)),
      'logo'    => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('clientes[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Clientes';
  }

}
